package models;

import java.io.Serializable;
import java.util.Date;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author eagle_eye
 */
@Entity
@Table(name = "DOCUMENTO", catalog = "sischool2", schema = "")
@NamedQueries({
    @NamedQuery(name = "Documento.findAll", query = "SELECT d FROM Documento d"),
    @NamedQuery(name = "Documento.findByIdDocumento", query = "SELECT d FROM Documento d WHERE d.idDocumento = :idDocumento"),
    @NamedQuery(name = "Documento.findByNombredoc", query = "SELECT d FROM Documento d WHERE d.nombredoc = :nombredoc"),
    @NamedQuery(name = "Documento.findByDescripciondoc", query = "SELECT d FROM Documento d WHERE d.descripciondoc = :descripciondoc"),
    @NamedQuery(name = "Documento.findByFecharealizacion", query = "SELECT d FROM Documento d WHERE d.fecharealizacion = :fecharealizacion"),
    @NamedQuery(name = "Documento.findByElaboradopor", query = "SELECT d FROM Documento d WHERE d.elaboradopor = :elaboradopor")})
public class Documento implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "idDocumento", nullable = false)
    private Integer idDocumento;
    @Column(name = "nombredoc", length = 45)
    private String nombredoc;
    @Column(name = "descripciondoc", length = 100)
    private String descripciondoc;
    @Column(name = "fecharealizacion")
    @Temporal(TemporalType.TIMESTAMP)
    private Date fecharealizacion;
    @Column(name = "elaboradopor", length = 64)
    private String elaboradopor;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "documentoId")
    private List<Certificado> certificadoList;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "documentoId")
    private List<Constancia> constanciaList;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "documentoId")
    private List<Decreto> decretoList;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "documentoId")
    private List<Acta> actaList;

    public Documento() {
    }

    public Documento(Integer idDocumento) {
        this.idDocumento = idDocumento;
    }

    public Integer getIdDocumento() {
        return idDocumento;
    }

    public void setIdDocumento(Integer idDocumento) {
        this.idDocumento = idDocumento;
    }

    public String getNombredoc() {
        return nombredoc;
    }

    public void setNombredoc(String nombredoc) {
        this.nombredoc = nombredoc;
    }

    public String getDescripciondoc() {
        return descripciondoc;
    }

    public void setDescripciondoc(String descripciondoc) {
        this.descripciondoc = descripciondoc;
    }

    public Date getFecharealizacion() {
        return fecharealizacion;
    }

    public void setFecharealizacion(Date fecharealizacion) {
        this.fecharealizacion = fecharealizacion;
    }

    public String getElaboradopor() {
        return elaboradopor;
    }

    public void setElaboradopor(String elaboradopor) {
        this.elaboradopor = elaboradopor;
    }

    public List<Certificado> getCertificadoList() {
        return certificadoList;
    }

    public void setCertificadoList(List<Certificado> certificadoList) {
        this.certificadoList = certificadoList;
    }

    public List<Constancia> getConstanciaList() {
        return constanciaList;
    }

    public void setConstanciaList(List<Constancia> constanciaList) {
        this.constanciaList = constanciaList;
    }

    public List<Decreto> getDecretoList() {
        return decretoList;
    }

    public void setDecretoList(List<Decreto> decretoList) {
        this.decretoList = decretoList;
    }

    public List<Acta> getActaList() {
        return actaList;
    }

    public void setActaList(List<Acta> actaList) {
        this.actaList = actaList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idDocumento != null ? idDocumento.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        if (!(object instanceof Documento)) {
            return false;
        }
        Documento other = (Documento) object;
        if ((this.idDocumento == null && other.idDocumento != null) || (this.idDocumento != null && !this.idDocumento.equals(other.idDocumento))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "models.Documento[idDocumento=" + idDocumento + "]";
    }

}
